<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>米行域名批量交易平台-交易所 用户注册</title>
<include file="./Public/public/public.html" />
<link rel="stylesheet" type="text/css" href="{$app_path}{$static_path}/css/register.css">
</head>
<body>
<include file="./Public/public/top.html" />
<div class="layout-wrap register">
	<div class="tab-group mobile-only">
		<a class="active">手机找回密码</a> <a>邮箱找回密码</a>
		<div class="clr"></div>
	</div>
	<div class="layout" style="background-color: #fff">
			<div class="swiper-wrapper" style="width: 2140px; height: 400px;">
				
			</div>
		</div>
		<div class="clr"></div>
	</div>
<include file="./Public/public/footer.html" />
<script type="text/javascript">
$(function(){
    $('.smslogin a[action=login]').on('click',leftlogin);
    $('.smslogin').find('input').on('keydown',function(){
        if (event.keyCode == "13") {
             $('.smslogin a[action=login]').click();
         }
    });
    $('.emailform a[action=login]').on('click',rightlogin);
    $('.emailform').find('input').on('keydown',function(){
        if (event.keyCode == "13") {
             $('.emailform a[action=login]').click();
         }
    });
    
    
    $("#11_timer1033").click(function(){
  		smsSend();
  	  });
	  /**
	   * 发送短信验证码
	   */
	  var smsSend=function(){
	 	 var obj=$("#11_timer1033");
	 	 var phone = $(obj.parents('form').find('[name=mobile]')[0]).val();
	 	 if(phone==null || phone.length==0) {
	 		 showModal('请输入正确格式的手机号码');
	 		 $(obj.parents('form').find('[name=mobile]')[0]).addClass("input-error");
	 		 return false;
	 	 } else if(phone.length==11) {
	 		 $(obj.parents('form').find('[name=mobile]')[0]).removeClass("input-error");
	 	 } 
	 	 var smsurl=$("#loginFormId").attr("action");
	 	 var len=smsurl.lastIndexOf("/");
	 	 smsurl=smsurl.substring(0,len);
	 	 smsurl=smsurl+"/sendLoginSms?mobile="+phone;
	 	 $.ajax({
	 		 type:'get',
	 		 url:smsurl,
	 		 success:function(data){
	 			 if(data.code=='error') {
	 				 showModal(data.info);
	 			 } else {
	 				 fun_timedown("11_timer1033",60);
	 				 showModal(data.info);
	 				 $("#11_timer1033").unbind("click");
	 			 }
	 		 }
	 	 });
	  };
	  
});

function leftlogin(){
    $('.smslogin').Qsubmit(null,function(msg){
        showModal(msg);
        $('.smslogin').find('img[name=img]').click();
    });
}
function rightlogin(){
    $('.emailform').Qsubmit(null,function(msg){
        showModal(msg);
        $('.emailform').find('img[name=img]').click();
    });
}
  /**
   * 倒计时
   */
  function fun_timedown(str,time) {
  	$("#"+str).text(time+"秒");
      time = time-1;
      if(time>=0){
          setTimeout("fun_timedown('"+str+"','"+time+"')",1000);
      }else{
      		$("#"+str).bind("click", function(){smsSend(str);});
      		$("#"+str).text("发送验证码");
      }
  }
  
  
</script>
</body>
</html>